package com.chat.module.client;

import cn.hutool.extra.spring.SpringUtil;

public enum ClientMessageServiceEnum {
    CHAT_MESSAGE(1, SpringUtil.getBean(ClientMessageService1.class)),
    ;

    private Integer code;
    private ClientMessageService service;

    ClientMessageServiceEnum(Integer code, ClientMessageService desc) {
        this.code = code;
        this.service = desc;
    }

    public static ClientMessageService getService(Integer code) {
        for (ClientMessageServiceEnum item : ClientMessageServiceEnum.values()) {
            if (item.code.equals(code)) {
                return item.service;
            }
        }
        return null;
    }
}
